package com.imooc.repository;

import com.imooc.entity.mo.MessageMO;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MessageRepository extends MongoRepository<MessageMO,String> {
    List<MessageMO> findAllByToUserIdOrderByCreateTimeDesc(String toUserId, Pageable pageable);
    void deleteAllByToUserIdAndFromUserIdAndMsgType(String toUserId,String fromUserId,Integer msgType);
}
